import request from "@/utils/request";

// 根据公司id查询公司员工所需信息详情
export function getEmpInfoRequires(companyId, type) {
  return request({
    url: `/hr/api/v1/companyEmpInfoRequires/byCompanyId/${companyId}/${type}`,
    method: "get"
  });
}

export function putEmpInfoRequires(companyEmpInfoRequireId, code, value) {
  return request({
    url: `/hr/api/v1/companyEmpInfoRequires/updateRequireById/${companyEmpInfoRequireId}/${code}/${value}`,
    method: "put"
  });
}

// 修改公司员工所需信息
export function putEmpRequires(data) {
  return request({
    url: `/hr/api/v1/companyEmpInfoRequires/updateRalation`,
    method: "PUT",
    data
  });
}
// 查询公司员工必填字段信息
export function getNecessaryFields(params) {
  return request({
    url: `/hr/api/v1/companyNecessaryFields/listAllForPc`,
    method: "get",
    params
  });
}

// 修改公司员工必填字段信息
export function postNecessaryFieldBatchDTO(data) {
  return request({
    url: `/hr/api/v1/companyNecessaryFields`,
    method: "put",
    data
  });
}
// 新增公司员工额外字段表
export function postAdditionalFieldsAddDTO(data) {
  return request({
    url: `/hr/api/v1/companyAdditionalFields/save2`,
    method: "post",
    data
  });
}
// 查询公司员工额外字段表
export function getAdditionalFieldsQuery(params) {
  return request({
    url: `/hr/api/v1/companyAdditionalFields/listAll`,
    method: "get",
    params
  });
}
// 删除公司员工额外字段表
export function deleteAdditionalFieldsQuery(id) {
  const url = `/hr/api/v1/companyAdditionalFields/deleteForPc2/${id}`;
  return request({
    url,
    method: "delete"
  });
}
// 修改公司员工额外字段信息
export function putAdditionalFieldsUpdateDTO(data) {
  return request({
    url: `/hr/api/v1/companyAdditionalFields/update2`,
    method: "put",
    data
  });
}
// 修改公司员工额外字段信息
export function putAdditionalFieldsOpen(data) {
  return request({
    url: `/hr/api/v1/companyAdditionalFields/openField`,
    method: "put",
    data
  });
}
// 修改公司员工额外字段信息
export function putAdditionalFieldsNecessary(data) {
  return request({
    url: `/hr/api/v1/companyAdditionalFields/necessaryField`,
    method: "put",
    data
  });
}
// 修改模块是否必须添加
export function putcompanyEmpNecessaries(data) {
  return request({
    url: `/hr/api/v1/companyEmpNecessaries`,
    method: "put",
    data
  });
}
